<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition
	template="#{pageContext.servletContext.contextPath}/templates/template.xhtml">
	<ui:define name="title">
		<h:outputText value="#{msg.grupo_titulo}" />
	</ui:define>

	<ui:define name="context">
			<h:form>
				<p:dataTable id="grupoactions" var="row" value="#{grupoactionBean.rows}"
					rowKey="#{row.nuSeqgrupoaction}" selection="#{grupoactionBean.entity}"
					selectionMode="single" emptyMessage="#{msg.warning_nenhum_registro_encontrado}">	
					<f:facet name="header">
						#{msg.grupoaction_consultar}
					</f:facet>			

					<p:column headerText="#{msg.grupoaction_grupo}">
						#{row.grupo.deGrupo}
					</p:column>
					<p:column headerText="#{msg.grupoaction_action}">
						#{row.action.deAction}
					</p:column>
					<p:column style="width:15px">
						<p:commandButton id="selectButton" icon="ui-icon-trash" title="Excluir" action="#{grupoactionBean.excluir}" ajax="false" onclick="return confirm('#{msg.confirma_exclusao_registro}')">
							<f:setPropertyActionListener value="#{row}" target="#{grupoactionBean.entity}" />
						</p:commandButton>
					</p:column>
				</p:dataTable>
				
			</h:form>

		<br />
		<h:form>
			<p:panel header="#{msg.grupoaction_cadastrar}">
				<p:messages showDetail="true" showSummary="false" />
				<h:inputHidden value="#{grupoactionBean.entity.nuSeqgrupoaction}" />
				<h:inputHidden value="#{grupoactionBean.entity.status}" />
				<h:panelGrid columns="4" columnClasses="headerColumn alignRight bold, emptyClass, headerColumn alignRight bold, emptyClass">
					<h:outputLabel value="#{msg.grupoaction_grupo}*:" for="selectGrupo" />

					<p:selectOneMenu value="#{grupoactionBean.cdGrupo}" id="selectGrupo" >
						<f:selectItem itemLabel="#{msg.selectonemenu_selecione}" itemValue="" />
						<f:selectItems value="#{grupoactionBean.grupos}" var="gru" itemLabel="#{gru.deGrupo}" itemValue="#{gru.cdGrupo}" />
					</p:selectOneMenu>

					<h:outputLabel value="#{msg.grupoaction_action}*:" for="selectAction" />
					<p:selectOneMenu value="#{grupoactionBean.cdAction}" id="selectAction" >
						<f:selectItem itemLabel="#{msg.selectonemenu_selecione}" itemValue="" />
						<f:selectItems value="#{grupoactionBean.actions}" var="action"  itemLabel="#{action.deAction}" itemValue="#{action.cdAction}" />
					</p:selectOneMenu>
				</h:panelGrid>
				<f:facet name="footer">
					<p:commandButton value="#{msg.button_save}"
						action="#{grupoactionBean.save}" ajax="false" />
				</f:facet>
			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>
</html>